package com.cans.impl;

import com.cans.api.IObserver;

/**
 * 劫匪
 *
 * @author shenc
 * @date 2021-11-27 15:16
 **/
public class Robber implements IObserver {

    /**
     * 劫匪名称
     */
    private String robberName;

    @Override
    public void setName(String name) {
        this.robberName = name;
    }

    @Override
    public void receive(String name, String msg) {
        // 接收到通知
        System.out.println("劫匪: " + this.robberName + "接收到" + name + "的消息: " + msg);
        // 张三行动
        System.out.println(this.robberName + ": 带着枪前去零元购");
    }
}
